import{d as f,p as _,k as h,aN as k,a9 as i,s as c,af as d,B as n,b as r,o as s,F as v,r as g,c as w,w as C,a as b,e as y,t as B,f as S,u as $,_ as N,bl as x}from"./CtbHscGXagutd.js";import{d as V,a as F,_ as L}from"./zLhWS5ASmTpqt.js";import"./CtybWkkwagutd.js";const D={class:"title"},E={key:0,class:"sort"},A=f({__name:"app-table-header",props:{columns:{}},setup(m){_("app-table-header");const o=h();k("updateScroll",e=>{o.value.style.marginLeft=`-${e}px`});const u=i(()=>(m.columns??V.value).map(e=>F.find(t=>t.name===e)));function p(e){if(c.workspace){const{asc:t}=d(n?.listSorting?.[0]??"date desc");n.listSorting=[x(e??"date",!t)]}}const l=i(()=>{if(c.workspace){const{field:e,asc:t}=d(n?.listSorting?.[0]??"date desc");return{name:e,asc:t}}return{name:"date",asc:!1}});return(e,t)=>(s(),r("div",{ref_key:"header",ref:o,class:"app-list-item-table-header"},[(s(!0),r(v,null,g(u.value,a=>(s(),w(L,{key:a.id,name:a.name,align:a.align,width:a.width,header:"",onClick:O=>p(a.name)},{default:C(()=>[b("span",D,B(e.$t(`table.header.${a.name}`)),1),l.value.name===a.name?(s(),r("span",E,[S($(N),{name:l.value.asc?"chevron-up":"chevron-down"},null,8,["name"])])):y("",!0)]),_:2},1032,["name","align","width","onClick"]))),128))],512))}});export{A as default};